package com.iflytek.aiui.uartkit.core;

import android.content.Context;

import com.upcontrol.uartagent.core.inter.DataReceive;
import com.usb2uartagent.IUARTConnectorHelper;

/**
 * Copyright (c) 2017, SuZhou CsjBot. All Rights Reserved.
 * www.csjbot.com
 * <p>
 * Created by 浦耀宗 at 2017/02/09 0009-14:06.
 * Email: puyz@csjbot.com
 */
public class UARTConnectorHelper implements IUARTConnectorHelper {
    static {
        UARTConnector.setManager(UARTManager.getManager());
    }

    public int init(Context context, String device, int speed) {
        return UARTConnector.init(device, speed);
    }

    public int send(byte[] data) {
        return UARTConnector.send(data);
    }

    public void destroy() {
        UARTConnector.destroy();
    }

    @Override
    public void setDataReceive(DataReceive receive) {

    }

    @Override
    public void onDataRecevie(byte[] data) {
        //UARTConnector内部已经绑定数据处理了
    }
}
